package roborally.conditionCombiners;
import roborally.*;
import roborally.Conditions.*;
import roborally.Commands.*;

/**
 * A class of Not-conditions for playing the roborally game, involving a condition that is to be negated.
 * 
 * @version  2.90
 * @author   Michiel Ruelens & Dieter Naten
 */
public class Not extends ConditionCombiner {
	
	private Statement condition;
	
	/**
	 * Create a new 'NOT' condition. This combiner will return true if it's parameter condition is false and vice versa.
	 * @param condition
	 */
	public Not(Statement condition){
		this.condition = condition;
		this.setStringForm("not ("+condition.getStringForm()+")");
	}
	
	@Override
	public boolean validate(Placeable placeable){
		boolean result = false;
		if(!condition.validate(placeable));{
			result = true;
		}
		return result;
	}

}
